﻿using System;
using System.Data;
using System.Text;
using System.Data.OracleClient;
using ChinaSoft.DBUtility;//Please add references
namespace ChinaSoft.DAL
{
	/// <summary>
	/// 数据访问类:DAL_T_PET_TRANSFER
	/// </summary>
	public partial class DAL_T_PET_TRANSFER
	{
		public DAL_T_PET_TRANSFER()
		{}
		#region  Method

		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(string PET_TRANSFER_ID)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) from T_PET_TRANSFER");
			strSql.Append(" where PET_TRANSFER_ID=:PET_TRANSFER_ID ");
			OracleParameter[] parameters = {
					new OracleParameter(":PET_TRANSFER_ID", OracleType.VarChar,40)			};
			parameters[0].Value = PET_TRANSFER_ID;

			return DbHelperOra.Exists(strSql.ToString(),parameters);
		}


		/// <summary>
		/// 增加一条数据
		/// </summary>
		public bool Add(ChinaSoft.Model.Model_T_PET_TRANSFER model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into T_PET_TRANSFER(");
			strSql.Append("PET_TRANSFER_ID,CURR_AREA_GRADE,ORIG_AREA_GRADE,CURR_AREA,ORIG_AREA,CURR_OWNER,ORIG_OWNER,CURR_ADDRESS,CURR_CARD_NUM,CURR_CARD_TYPE,CURR_PET_ADD,CURR_PHONE,CURR_POST_NUM,NOTE,ORIG_ADDRESS,ORIG_CARD_NUM,ORIG_CARD_TYPE,ORIG_PET_ADD,ORIG_PHONE,ORIG_POST_NUM,PET_ID,REG_ORG_ID,TRANSFER_DATE,TRANSFER_NO,TYPE,CREATE_TIME,CREATOR_ID,UPDATE_TIME,UPDATOR_ID)");
			strSql.Append(" values (");
			strSql.Append(":PET_TRANSFER_ID,:CURR_AREA_GRADE,:ORIG_AREA_GRADE,:CURR_AREA,:ORIG_AREA,:CURR_OWNER,:ORIG_OWNER,:CURR_ADDRESS,:CURR_CARD_NUM,:CURR_CARD_TYPE,:CURR_PET_ADD,:CURR_PHONE,:CURR_POST_NUM,:NOTE,:ORIG_ADDRESS,:ORIG_CARD_NUM,:ORIG_CARD_TYPE,:ORIG_PET_ADD,:ORIG_PHONE,:ORIG_POST_NUM,:PET_ID,:REG_ORG_ID,:TRANSFER_DATE,:TRANSFER_NO,:TYPE,:CREATE_TIME,:CREATOR_ID,:UPDATE_TIME,:UPDATOR_ID)");
			OracleParameter[] parameters = {
					new OracleParameter(":PET_TRANSFER_ID", OracleType.VarChar,40),
					new OracleParameter(":CURR_AREA_GRADE", OracleType.Number,19),
					new OracleParameter(":ORIG_AREA_GRADE", OracleType.Number,19),
					new OracleParameter(":CURR_AREA", OracleType.Number,19),
					new OracleParameter(":ORIG_AREA", OracleType.Number,19),
					new OracleParameter(":CURR_OWNER", OracleType.VarChar,40),
					new OracleParameter(":ORIG_OWNER", OracleType.VarChar,40),
					new OracleParameter(":CURR_ADDRESS", OracleType.NVarChar),
					new OracleParameter(":CURR_CARD_NUM", OracleType.NVarChar),
					new OracleParameter(":CURR_CARD_TYPE", OracleType.Number,10),
					new OracleParameter(":CURR_PET_ADD", OracleType.NVarChar),
					new OracleParameter(":CURR_PHONE", OracleType.NVarChar),
					new OracleParameter(":CURR_POST_NUM", OracleType.NVarChar),
					new OracleParameter(":NOTE", OracleType.NVarChar),
					new OracleParameter(":ORIG_ADDRESS", OracleType.NVarChar),
					new OracleParameter(":ORIG_CARD_NUM", OracleType.NVarChar),
					new OracleParameter(":ORIG_CARD_TYPE", OracleType.Number,10),
					new OracleParameter(":ORIG_PET_ADD", OracleType.NVarChar),
					new OracleParameter(":ORIG_PHONE", OracleType.NVarChar),
					new OracleParameter(":ORIG_POST_NUM", OracleType.NVarChar),
					new OracleParameter(":PET_ID", OracleType.VarChar,40),
					new OracleParameter(":REG_ORG_ID", OracleType.VarChar,40),
					new OracleParameter(":TRANSFER_DATE", OracleType.DateTime),
					new OracleParameter(":TRANSFER_NO", OracleType.NVarChar),
					new OracleParameter(":TYPE", OracleType.Number,10),
					new OracleParameter(":CREATE_TIME", OracleType.DateTime),
					new OracleParameter(":CREATOR_ID", OracleType.VarChar,40),
					new OracleParameter(":UPDATE_TIME", OracleType.DateTime),
					new OracleParameter(":UPDATOR_ID", OracleType.VarChar,40)};
			parameters[0].Value = model.PET_TRANSFER_ID;
			parameters[1].Value = model.CURR_AREA_GRADE;
			parameters[2].Value = model.ORIG_AREA_GRADE;
			parameters[3].Value = model.CURR_AREA;
			parameters[4].Value = model.ORIG_AREA;
			parameters[5].Value = model.CURR_OWNER;
			parameters[6].Value = model.ORIG_OWNER;
			parameters[7].Value = model.CURR_ADDRESS;
			parameters[8].Value = model.CURR_CARD_NUM;
			parameters[9].Value = model.CURR_CARD_TYPE;
			parameters[10].Value = model.CURR_PET_ADD;
			parameters[11].Value = model.CURR_PHONE;
			parameters[12].Value = model.CURR_POST_NUM;
			parameters[13].Value = model.NOTE;
			parameters[14].Value = model.ORIG_ADDRESS;
			parameters[15].Value = model.ORIG_CARD_NUM;
			parameters[16].Value = model.ORIG_CARD_TYPE;
			parameters[17].Value = model.ORIG_PET_ADD;
			parameters[18].Value = model.ORIG_PHONE;
			parameters[19].Value = model.ORIG_POST_NUM;
			parameters[20].Value = model.PET_ID;
			parameters[21].Value = model.REG_ORG_ID;
			parameters[22].Value = model.TRANSFER_DATE;
			parameters[23].Value = model.TRANSFER_NO;
			parameters[24].Value = model.TYPE;
			parameters[25].Value = model.CREATE_TIME;
			parameters[26].Value = model.CREATOR_ID;
			parameters[27].Value = model.UPDATE_TIME;
			parameters[28].Value = model.UPDATOR_ID;

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(ChinaSoft.Model.Model_T_PET_TRANSFER model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update T_PET_TRANSFER set ");
			strSql.Append("CURR_AREA_GRADE=:CURR_AREA_GRADE,");
			strSql.Append("ORIG_AREA_GRADE=:ORIG_AREA_GRADE,");
			strSql.Append("CURR_AREA=:CURR_AREA,");
			strSql.Append("ORIG_AREA=:ORIG_AREA,");
			strSql.Append("CURR_OWNER=:CURR_OWNER,");
			strSql.Append("ORIG_OWNER=:ORIG_OWNER,");
			strSql.Append("CURR_ADDRESS=:CURR_ADDRESS,");
			strSql.Append("CURR_CARD_NUM=:CURR_CARD_NUM,");
			strSql.Append("CURR_CARD_TYPE=:CURR_CARD_TYPE,");
			strSql.Append("CURR_PET_ADD=:CURR_PET_ADD,");
			strSql.Append("CURR_PHONE=:CURR_PHONE,");
			strSql.Append("CURR_POST_NUM=:CURR_POST_NUM,");
			strSql.Append("NOTE=:NOTE,");
			strSql.Append("ORIG_ADDRESS=:ORIG_ADDRESS,");
			strSql.Append("ORIG_CARD_NUM=:ORIG_CARD_NUM,");
			strSql.Append("ORIG_CARD_TYPE=:ORIG_CARD_TYPE,");
			strSql.Append("ORIG_PET_ADD=:ORIG_PET_ADD,");
			strSql.Append("ORIG_PHONE=:ORIG_PHONE,");
			strSql.Append("ORIG_POST_NUM=:ORIG_POST_NUM,");
			strSql.Append("PET_ID=:PET_ID,");
			strSql.Append("REG_ORG_ID=:REG_ORG_ID,");
			strSql.Append("TRANSFER_DATE=:TRANSFER_DATE,");
			strSql.Append("TRANSFER_NO=:TRANSFER_NO,");
			strSql.Append("TYPE=:TYPE,");
			strSql.Append("CREATE_TIME=:CREATE_TIME,");
			strSql.Append("CREATOR_ID=:CREATOR_ID,");
			strSql.Append("UPDATE_TIME=:UPDATE_TIME,");
			strSql.Append("UPDATOR_ID=:UPDATOR_ID");
			strSql.Append(" where PET_TRANSFER_ID=:PET_TRANSFER_ID ");
			OracleParameter[] parameters = {
					new OracleParameter(":CURR_AREA_GRADE", OracleType.Number,19),
					new OracleParameter(":ORIG_AREA_GRADE", OracleType.Number,19),
					new OracleParameter(":CURR_AREA", OracleType.Number,19),
					new OracleParameter(":ORIG_AREA", OracleType.Number,19),
					new OracleParameter(":CURR_OWNER", OracleType.VarChar,40),
					new OracleParameter(":ORIG_OWNER", OracleType.VarChar,40),
					new OracleParameter(":CURR_ADDRESS", OracleType.NVarChar),
					new OracleParameter(":CURR_CARD_NUM", OracleType.NVarChar),
					new OracleParameter(":CURR_CARD_TYPE", OracleType.Number,10),
					new OracleParameter(":CURR_PET_ADD", OracleType.NVarChar),
					new OracleParameter(":CURR_PHONE", OracleType.NVarChar),
					new OracleParameter(":CURR_POST_NUM", OracleType.NVarChar),
					new OracleParameter(":NOTE", OracleType.NVarChar),
					new OracleParameter(":ORIG_ADDRESS", OracleType.NVarChar),
					new OracleParameter(":ORIG_CARD_NUM", OracleType.NVarChar),
					new OracleParameter(":ORIG_CARD_TYPE", OracleType.Number,10),
					new OracleParameter(":ORIG_PET_ADD", OracleType.NVarChar),
					new OracleParameter(":ORIG_PHONE", OracleType.NVarChar),
					new OracleParameter(":ORIG_POST_NUM", OracleType.NVarChar),
					new OracleParameter(":PET_ID", OracleType.VarChar,40),
					new OracleParameter(":REG_ORG_ID", OracleType.VarChar,40),
					new OracleParameter(":TRANSFER_DATE", OracleType.DateTime),
					new OracleParameter(":TRANSFER_NO", OracleType.NVarChar),
					new OracleParameter(":TYPE", OracleType.Number,10),
					new OracleParameter(":CREATE_TIME", OracleType.DateTime),
					new OracleParameter(":CREATOR_ID", OracleType.VarChar,40),
					new OracleParameter(":UPDATE_TIME", OracleType.DateTime),
					new OracleParameter(":UPDATOR_ID", OracleType.VarChar,40),
					new OracleParameter(":PET_TRANSFER_ID", OracleType.VarChar,40)};
			parameters[0].Value = model.CURR_AREA_GRADE;
			parameters[1].Value = model.ORIG_AREA_GRADE;
			parameters[2].Value = model.CURR_AREA;
			parameters[3].Value = model.ORIG_AREA;
			parameters[4].Value = model.CURR_OWNER;
			parameters[5].Value = model.ORIG_OWNER;
			parameters[6].Value = model.CURR_ADDRESS;
			parameters[7].Value = model.CURR_CARD_NUM;
			parameters[8].Value = model.CURR_CARD_TYPE;
			parameters[9].Value = model.CURR_PET_ADD;
			parameters[10].Value = model.CURR_PHONE;
			parameters[11].Value = model.CURR_POST_NUM;
			parameters[12].Value = model.NOTE;
			parameters[13].Value = model.ORIG_ADDRESS;
			parameters[14].Value = model.ORIG_CARD_NUM;
			parameters[15].Value = model.ORIG_CARD_TYPE;
			parameters[16].Value = model.ORIG_PET_ADD;
			parameters[17].Value = model.ORIG_PHONE;
			parameters[18].Value = model.ORIG_POST_NUM;
			parameters[19].Value = model.PET_ID;
			parameters[20].Value = model.REG_ORG_ID;
			parameters[21].Value = model.TRANSFER_DATE;
			parameters[22].Value = model.TRANSFER_NO;
			parameters[23].Value = model.TYPE;
			parameters[24].Value = model.CREATE_TIME;
			parameters[25].Value = model.CREATOR_ID;
			parameters[26].Value = model.UPDATE_TIME;
			parameters[27].Value = model.UPDATOR_ID;
			parameters[28].Value = model.PET_TRANSFER_ID;

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete(string PET_TRANSFER_ID)
		{
			
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from T_PET_TRANSFER ");
			strSql.Append(" where PET_TRANSFER_ID=:PET_TRANSFER_ID ");
			OracleParameter[] parameters = {
					new OracleParameter(":PET_TRANSFER_ID", OracleType.VarChar,40)			};
			parameters[0].Value = PET_TRANSFER_ID;

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 批量删除数据
		/// </summary>
		public bool DeleteList(string PET_TRANSFER_IDlist )
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from T_PET_TRANSFER ");
			strSql.Append(" where PET_TRANSFER_ID in ("+PET_TRANSFER_IDlist + ")  ");
			int rows=DbHelperOra.ExecuteSql(strSql.ToString());
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}


		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public ChinaSoft.Model.Model_T_PET_TRANSFER GetModel(string PET_TRANSFER_ID)
		{
			
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select PET_TRANSFER_ID,CURR_AREA_GRADE,ORIG_AREA_GRADE,CURR_AREA,ORIG_AREA,CURR_OWNER,ORIG_OWNER,CURR_ADDRESS,CURR_CARD_NUM,CURR_CARD_TYPE,CURR_PET_ADD,CURR_PHONE,CURR_POST_NUM,NOTE,ORIG_ADDRESS,ORIG_CARD_NUM,ORIG_CARD_TYPE,ORIG_PET_ADD,ORIG_PHONE,ORIG_POST_NUM,PET_ID,REG_ORG_ID,TRANSFER_DATE,TRANSFER_NO,TYPE,CREATE_TIME,CREATOR_ID,UPDATE_TIME,UPDATOR_ID from T_PET_TRANSFER ");
			strSql.Append(" where PET_TRANSFER_ID=:PET_TRANSFER_ID ");
			OracleParameter[] parameters = {
					new OracleParameter(":PET_TRANSFER_ID", OracleType.VarChar,40)			};
			parameters[0].Value = PET_TRANSFER_ID;

			ChinaSoft.Model.Model_T_PET_TRANSFER model=new ChinaSoft.Model.Model_T_PET_TRANSFER();
			DataSet ds=DbHelperOra.Query(strSql.ToString(),parameters);
			if(ds.Tables[0].Rows.Count>0)
			{
				if(ds.Tables[0].Rows[0]["PET_TRANSFER_ID"]!=null && ds.Tables[0].Rows[0]["PET_TRANSFER_ID"].ToString()!="")
				{
					model.PET_TRANSFER_ID=ds.Tables[0].Rows[0]["PET_TRANSFER_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["CURR_AREA_GRADE"]!=null && ds.Tables[0].Rows[0]["CURR_AREA_GRADE"].ToString()!="")
				{
					model.CURR_AREA_GRADE=decimal.Parse(ds.Tables[0].Rows[0]["CURR_AREA_GRADE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["ORIG_AREA_GRADE"]!=null && ds.Tables[0].Rows[0]["ORIG_AREA_GRADE"].ToString()!="")
				{
					model.ORIG_AREA_GRADE=decimal.Parse(ds.Tables[0].Rows[0]["ORIG_AREA_GRADE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["CURR_AREA"]!=null && ds.Tables[0].Rows[0]["CURR_AREA"].ToString()!="")
				{
					model.CURR_AREA=decimal.Parse(ds.Tables[0].Rows[0]["CURR_AREA"].ToString());
				}
				if(ds.Tables[0].Rows[0]["ORIG_AREA"]!=null && ds.Tables[0].Rows[0]["ORIG_AREA"].ToString()!="")
				{
					model.ORIG_AREA=decimal.Parse(ds.Tables[0].Rows[0]["ORIG_AREA"].ToString());
				}
				if(ds.Tables[0].Rows[0]["CURR_OWNER"]!=null && ds.Tables[0].Rows[0]["CURR_OWNER"].ToString()!="")
				{
					model.CURR_OWNER=ds.Tables[0].Rows[0]["CURR_OWNER"].ToString();
				}
				if(ds.Tables[0].Rows[0]["ORIG_OWNER"]!=null && ds.Tables[0].Rows[0]["ORIG_OWNER"].ToString()!="")
				{
					model.ORIG_OWNER=ds.Tables[0].Rows[0]["ORIG_OWNER"].ToString();
				}
				if(ds.Tables[0].Rows[0]["CURR_ADDRESS"]!=null && ds.Tables[0].Rows[0]["CURR_ADDRESS"].ToString()!="")
				{
					model.CURR_ADDRESS=ds.Tables[0].Rows[0]["CURR_ADDRESS"].ToString();
				}
				if(ds.Tables[0].Rows[0]["CURR_CARD_NUM"]!=null && ds.Tables[0].Rows[0]["CURR_CARD_NUM"].ToString()!="")
				{
					model.CURR_CARD_NUM=ds.Tables[0].Rows[0]["CURR_CARD_NUM"].ToString();
				}
				if(ds.Tables[0].Rows[0]["CURR_CARD_TYPE"]!=null && ds.Tables[0].Rows[0]["CURR_CARD_TYPE"].ToString()!="")
				{
					model.CURR_CARD_TYPE=decimal.Parse(ds.Tables[0].Rows[0]["CURR_CARD_TYPE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["CURR_PET_ADD"]!=null && ds.Tables[0].Rows[0]["CURR_PET_ADD"].ToString()!="")
				{
					model.CURR_PET_ADD=ds.Tables[0].Rows[0]["CURR_PET_ADD"].ToString();
				}
				if(ds.Tables[0].Rows[0]["CURR_PHONE"]!=null && ds.Tables[0].Rows[0]["CURR_PHONE"].ToString()!="")
				{
					model.CURR_PHONE=ds.Tables[0].Rows[0]["CURR_PHONE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["CURR_POST_NUM"]!=null && ds.Tables[0].Rows[0]["CURR_POST_NUM"].ToString()!="")
				{
					model.CURR_POST_NUM=ds.Tables[0].Rows[0]["CURR_POST_NUM"].ToString();
				}
				if(ds.Tables[0].Rows[0]["NOTE"]!=null && ds.Tables[0].Rows[0]["NOTE"].ToString()!="")
				{
					model.NOTE=ds.Tables[0].Rows[0]["NOTE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["ORIG_ADDRESS"]!=null && ds.Tables[0].Rows[0]["ORIG_ADDRESS"].ToString()!="")
				{
					model.ORIG_ADDRESS=ds.Tables[0].Rows[0]["ORIG_ADDRESS"].ToString();
				}
				if(ds.Tables[0].Rows[0]["ORIG_CARD_NUM"]!=null && ds.Tables[0].Rows[0]["ORIG_CARD_NUM"].ToString()!="")
				{
					model.ORIG_CARD_NUM=ds.Tables[0].Rows[0]["ORIG_CARD_NUM"].ToString();
				}
				if(ds.Tables[0].Rows[0]["ORIG_CARD_TYPE"]!=null && ds.Tables[0].Rows[0]["ORIG_CARD_TYPE"].ToString()!="")
				{
					model.ORIG_CARD_TYPE=decimal.Parse(ds.Tables[0].Rows[0]["ORIG_CARD_TYPE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["ORIG_PET_ADD"]!=null && ds.Tables[0].Rows[0]["ORIG_PET_ADD"].ToString()!="")
				{
					model.ORIG_PET_ADD=ds.Tables[0].Rows[0]["ORIG_PET_ADD"].ToString();
				}
				if(ds.Tables[0].Rows[0]["ORIG_PHONE"]!=null && ds.Tables[0].Rows[0]["ORIG_PHONE"].ToString()!="")
				{
					model.ORIG_PHONE=ds.Tables[0].Rows[0]["ORIG_PHONE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["ORIG_POST_NUM"]!=null && ds.Tables[0].Rows[0]["ORIG_POST_NUM"].ToString()!="")
				{
					model.ORIG_POST_NUM=ds.Tables[0].Rows[0]["ORIG_POST_NUM"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PET_ID"]!=null && ds.Tables[0].Rows[0]["PET_ID"].ToString()!="")
				{
					model.PET_ID=ds.Tables[0].Rows[0]["PET_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["REG_ORG_ID"]!=null && ds.Tables[0].Rows[0]["REG_ORG_ID"].ToString()!="")
				{
					model.REG_ORG_ID=ds.Tables[0].Rows[0]["REG_ORG_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["TRANSFER_DATE"]!=null && ds.Tables[0].Rows[0]["TRANSFER_DATE"].ToString()!="")
				{
					model.TRANSFER_DATE=DateTime.Parse(ds.Tables[0].Rows[0]["TRANSFER_DATE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["TRANSFER_NO"]!=null && ds.Tables[0].Rows[0]["TRANSFER_NO"].ToString()!="")
				{
					model.TRANSFER_NO=ds.Tables[0].Rows[0]["TRANSFER_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["TYPE"]!=null && ds.Tables[0].Rows[0]["TYPE"].ToString()!="")
				{
					model.TYPE=decimal.Parse(ds.Tables[0].Rows[0]["TYPE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["CREATE_TIME"]!=null && ds.Tables[0].Rows[0]["CREATE_TIME"].ToString()!="")
				{
					model.CREATE_TIME=DateTime.Parse(ds.Tables[0].Rows[0]["CREATE_TIME"].ToString());
				}
				if(ds.Tables[0].Rows[0]["CREATOR_ID"]!=null && ds.Tables[0].Rows[0]["CREATOR_ID"].ToString()!="")
				{
					model.CREATOR_ID=ds.Tables[0].Rows[0]["CREATOR_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["UPDATE_TIME"]!=null && ds.Tables[0].Rows[0]["UPDATE_TIME"].ToString()!="")
				{
					model.UPDATE_TIME=DateTime.Parse(ds.Tables[0].Rows[0]["UPDATE_TIME"].ToString());
				}
				if(ds.Tables[0].Rows[0]["UPDATOR_ID"]!=null && ds.Tables[0].Rows[0]["UPDATOR_ID"].ToString()!="")
				{
					model.UPDATOR_ID=ds.Tables[0].Rows[0]["UPDATOR_ID"].ToString();
				}
				return model;
			}
			else
			{
				return null;
			}
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetList(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select PET_TRANSFER_ID,CURR_AREA_GRADE,ORIG_AREA_GRADE,CURR_AREA,ORIG_AREA,CURR_OWNER,ORIG_OWNER,CURR_ADDRESS,CURR_CARD_NUM,CURR_CARD_TYPE,CURR_PET_ADD,CURR_PHONE,CURR_POST_NUM,NOTE,ORIG_ADDRESS,ORIG_CARD_NUM,ORIG_CARD_TYPE,ORIG_PET_ADD,ORIG_PHONE,ORIG_POST_NUM,PET_ID,REG_ORG_ID,TRANSFER_DATE,TRANSFER_NO,TYPE,CREATE_TIME,CREATOR_ID,UPDATE_TIME,UPDATOR_ID ");
			strSql.Append(" FROM T_PET_TRANSFER ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			return DbHelperOra.Query(strSql.ToString());
		}

		/// <summary>
		/// 获取记录总数
		/// </summary>
		public int GetRecordCount(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) FROM T_PET_TRANSFER ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			object obj = DbHelperSQL.GetSingle(strSql.ToString());
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("SELECT * FROM ( ");
			strSql.Append(" SELECT ROW_NUMBER() OVER (");
			if (!string.IsNullOrEmpty(orderby.Trim()))
			{
				strSql.Append("order by T." + orderby );
			}
			else
			{
				strSql.Append("order by T.PET_TRANSFER_ID desc");
			}
			strSql.Append(")AS Row, T.*  from T_PET_TRANSFER T ");
			if (!string.IsNullOrEmpty(strWhere.Trim()))
			{
				strSql.Append(" WHERE " + strWhere);
			}
			strSql.Append(" ) TT");
			strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
			return DbHelperOra.Query(strSql.ToString());
		}

		/*
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
		{
			OracleParameter[] parameters = {
					new OracleParameter(":tblName", OracleType.VarChar, 255),
					new OracleParameter(":fldName", OracleType.VarChar, 255),
					new OracleParameter(":PageSize", OracleType.Number),
					new OracleParameter(":PageIndex", OracleType.Number),
					new OracleParameter(":IsReCount", OracleType.Clob),
					new OracleParameter(":OrderType", OracleType.Clob),
					new OracleParameter(":strWhere", OracleType.VarChar,1000),
					};
			parameters[0].Value = "T_PET_TRANSFER";
			parameters[1].Value = "PET_TRANSFER_ID";
			parameters[2].Value = PageSize;
			parameters[3].Value = PageIndex;
			parameters[4].Value = 0;
			parameters[5].Value = 0;
			parameters[6].Value = strWhere;	
			return DbHelperOra.RunProcedure("UP_GetRecordByPage",parameters,"ds");
		}*/

		#endregion  Method
	}
}

